{% extends 'base.html' %}

{% block page_title %}Galaxy Site{% endblock %}
{% block content_title %}Latest posts{% endblock %}

{% block content %}
<div class="post_list">
	{% for post in object_list %}
	<div>
		<h3 class="title"><a href="{{ post.get_absolute_url }}">{% autoescape off %}{{ post.title }}{% endautoescape %}</a> by {% if post.author %}{{ post.author }}{% else %}<a href="{{ post.blog.get_absolute_url }}">{{ post.blog.name }}</a>{% endif %}</h3>
		<p class="date">{{ post.posted|date:"Y F d" }}</p>
		<p class="body">{% autoescape off %}{{ post.body|removetags:"div script"|safe }}{% endautoescape %}</p>
	</div>
	{% endfor %}
</div>

{% if is_paginated %}
<p class="pagination">
	{% if has_next %}
	<a class="older" href="?page={{ next }}">Older</a>
	{% endif %}
	{% if has_next and has_previous %} | {% endif %}
	{% if has_previous %}
	<a class="newer" href="?page={{ previous }}">Newer</a>
	{% endif %}
</p>
{% endif %}
{% endblock %}